package com.example.high_slope_electronic_sand_table.deviceStatus.service;

import cn.hutool.core.date.DatePattern;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.RandomUtil;
import com.example.high_slope_electronic_sand_table.deviceStatus.dto.RadarDeviceStatusDTO;
import org.springframework.stereotype.Service;

@Service
public class RadarDeviceStatusService {
    /**
     * 查询雷达设备状态信息
     *
     * @return
     */
    public RadarDeviceStatusDTO getRadarDeviceStatus(){
        RadarDeviceStatusDTO radarDeviceStatusDTO = new RadarDeviceStatusDTO();
        // 设备ID
//        radarDeviceStatusDTO.setDeviceId();
        // 形变测量精度
        radarDeviceStatusDTO.setDeformationMeasurementAccuracy("优于0.1mm");
        // 数据变更频率
        radarDeviceStatusDTO.setDataChangeFrequency(RandomUtil.randomInt(3,6));
        // 最大探测距离
        radarDeviceStatusDTO.setMaximumDetectableRange("5000m");
        // 监测范围
        radarDeviceStatusDTO.setMonitorRange("120°×45°");
        // 雷达总功耗
        radarDeviceStatusDTO.setTotalRadarPowerConsumption("≤40W");
        // 防护能力
        radarDeviceStatusDTO.setProtectiveCapability("IP54");
        // 工作温度
        radarDeviceStatusDTO.setOperatingTemperature(RandomUtil.randomFloat(-25, 45));
        // 雷达尺寸
        radarDeviceStatusDTO.setRadarSize("55cm*35cm*10cm");
        // 网络 有线、WiFi、4G/5G
        radarDeviceStatusDTO.setNetwork("有线、WiFi、4G/5G");
        // 重量
        radarDeviceStatusDTO.setWeight("单模块≤10kg");
        // 生成时间、当前时间
        radarDeviceStatusDTO.setDatetime(DateUtil.format(DateUtil.date(), DatePattern.NORM_DATETIME_PATTERN));
        return radarDeviceStatusDTO;
    }
}
